.class Lcom/waiqin365/h5/io/a;
.super Ljava/lang/Object;

# interfaces
.implements Ljava/lang/Runnable;


# instance fields
.field final synthetic a:Lcom/waiqin365/h5/io/WqDownloadFile;


# direct methods
.method constructor <init>(Lcom/waiqin365/h5/io/WqDownloadFile;)V
    .locals 0

    iput-object p1, p0, Lcom/waiqin365/h5/io/a;->a:Lcom/waiqin365/h5/io/WqDownloadFile;

    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    return-void
.end method


# virtual methods
.method public run()V
    .locals 7

    const/4 v6, 0x1

    iget-object v0, p0, Lcom/waiqin365/h5/io/a;->a:Lcom/waiqin365/h5/io/WqDownloadFile;

    invoke-static {v0}, Lcom/waiqin365/h5/io/WqDownloadFile;->a(Lcom/waiqin365/h5/io/WqDownloadFile;)Ljava/lang/String;

    move-result-object v0

    invoke-static {v0}, Landroid/text/TextUtils;->isEmpty(Ljava/lang/CharSequence;)Z

    move-result v0

    if-nez v0, :cond_5

    new-instance v4, Lcom/waiqin365/h5/io/b/a;

    invoke-direct {v4}, Lcom/waiqin365/h5/io/b/a;-><init>()V

    :try_start_0
    new-instance v5, Lorg/json/JSONObject;

    iget-object v0, p0, Lcom/waiqin365/h5/io/a;->a:Lcom/waiqin365/h5/io/WqDownloadFile;

    invoke-static {v0}, Lcom/waiqin365/h5/io/WqDownloadFile;->a(Lcom/waiqin365/h5/io/WqDownloadFile;)Ljava/lang/String;

    move-result-object v0

    invoke-direct {v5, v0}, Lorg/json/JSONObject;-><init>(Ljava/lang/String;)V

    const-string/jumbo v0, "id"

    invoke-virtual {v5, v0}, Lorg/json/JSONObject;->has(Ljava/lang/String;)Z

    move-result v0

    if-eqz v0, :cond_0

    const-string/jumbo v0, "id"

    invoke-virtual {v5, v0}, Lorg/json/JSONObject;->getString(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v0

    move-object v3, v0

    :goto_0
    const-string/jumbo v0, "fileName"

    invoke-virtual {v5, v0}, Lorg/json/JSONObject;->has(Ljava/lang/String;)Z

    move-result v0

    if-eqz v0, :cond_1

    const-string/jumbo v0, "fileName"

    invoke-virtual {v5, v0}, Lorg/json/JSONObject;->getString(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v0

    move-object v2, v0

    :goto_1
    const-string/jumbo v0, "downloadUrl"

    invoke-virtual {v5, v0}, Lorg/json/JSONObject;->has(Ljava/lang/String;)Z

    move-result v0

    if-eqz v0, :cond_2

    const-string/jumbo v0, "downloadUrl"

    invoke-virtual {v5, v0}, Lorg/json/JSONObject;->getString(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v0

    move-object v1, v0

    :goto_2
    const-string/jumbo v0, "size"

    invoke-virtual {v5, v0}, Lorg/json/JSONObject;->has(Ljava/lang/String;)Z

    move-result v0

    if-eqz v0, :cond_3

    const-string/jumbo v0, "size"

    invoke-virtual {v5, v0}, Lorg/json/JSONObject;->getInt(Ljava/lang/String;)I

    move-result v0

    :goto_3
    invoke-static {v1}, Landroid/text/TextUtils;->isEmpty(Ljava/lang/CharSequence;)Z

    move-result v5

    if-nez v5, :cond_4

    iput-object v1, v4, Lcom/waiqin365/h5/io/b/a;->d:Ljava/lang/String;

    iput-object v3, v4, Lcom/waiqin365/h5/io/b/a;->a:Ljava/lang/String;

    iput-object v2, v4, Lcom/waiqin365/h5/io/b/a;->b:Ljava/lang/String;

    iput v0, v4, Lcom/waiqin365/h5/io/b/a;->c:I

    new-instance v0, Lcom/waiqin365/h5/io/a/a/a;

    invoke-direct {v0, v4}, Lcom/waiqin365/h5/io/a/a/a;-><init>(Lcom/waiqin365/h5/io/b/a;)V

    new-instance v1, Lcom/waiqin365/h5/io/a/b;

    iget-object v2, p0, Lcom/waiqin365/h5/io/a;->a:Lcom/waiqin365/h5/io/WqDownloadFile;

    invoke-static {v2}, Lcom/waiqin365/h5/io/WqDownloadFile;->b(Lcom/waiqin365/h5/io/WqDownloadFile;)Lorg/apache/cordova/WqCordovaActivity;

    move-result-object v2

    iget-object v2, v2, Lorg/apache/cordova/WqCordovaActivity;->mHandler:Landroid/os/Handler;

    invoke-direct {v1, v2, v0}, Lcom/waiqin365/h5/io/a/b;-><init>(Landroid/os/Handler;Lcom/waiqin365/h5/io/a/c;)V

    invoke-virtual {v1}, Lcom/waiqin365/h5/io/a/b;->start()V

    :goto_4
    return-void

    :cond_0
    const-string/jumbo v0, ""

    move-object v3, v0

    goto :goto_0

    :cond_1
    const-string/jumbo v0, ""

    move-object v2, v0

    goto :goto_1

    :cond_2
    const-string/jumbo v0, ""

    move-object v1, v0

    goto :goto_2

    :cond_3
    const/4 v0, 0x0

    goto :goto_3

    :cond_4
    iget-object v0, p0, Lcom/waiqin365/h5/io/a;->a:Lcom/waiqin365/h5/io/WqDownloadFile;

    const/4 v1, 0x1

    invoke-static {v0, v1}, Lcom/waiqin365/h5/io/WqDownloadFile;->a(Lcom/waiqin365/h5/io/WqDownloadFile;Z)Z
    :try_end_0
    .catch Lorg/json/JSONException; {:try_start_0 .. :try_end_0} :catch_0

    goto :goto_4

    :catch_0
    move-exception v0

    invoke-virtual {v0}, Lorg/json/JSONException;->printStackTrace()V

    iget-object v0, p0, Lcom/waiqin365/h5/io/a;->a:Lcom/waiqin365/h5/io/WqDownloadFile;

    invoke-static {v0, v6}, Lcom/waiqin365/h5/io/WqDownloadFile;->a(Lcom/waiqin365/h5/io/WqDownloadFile;Z)Z

    goto :goto_4

    :cond_5
    iget-object v0, p0, Lcom/waiqin365/h5/io/a;->a:Lcom/waiqin365/h5/io/WqDownloadFile;

    invoke-static {v0, v6}, Lcom/waiqin365/h5/io/WqDownloadFile;->a(Lcom/waiqin365/h5/io/WqDownloadFile;Z)Z

    goto :goto_4
.end method
